import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  Widget buildBody() {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Container(
          width: 300,
          height: 150,
          // color: Colors.orange,
          margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
          padding: EdgeInsets.all(20),
          // 内容
          child: Text('我了个去\n你人呢\n哪去了\n????'),
          // 装饰
          decoration: BoxDecoration(
            color: Colors.brown,
            borderRadius: BorderRadius.all(
              Radius.circular(18),
            ),
            gradient: RadialGradient(
              colors: [Colors.red, Colors.orange],
              center: Alignment.topRight,
              radius: 2,
            ),
            boxShadow: [
              BoxShadow(
                blurRadius: 2,
                offset: Offset(2, 4),
                color: Colors.blueGrey,
              ),
            ],
            image: DecorationImage(
              image: AssetImage('assets/renne.gif'),
              fit: BoxFit.cover,
            ),
            backgroundBlendMode: BlendMode.color,
          ),
          // 旋转
          transform: Matrix4.rotationZ(0.3),
        ),
      ],
    );
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Material App',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Material App Bar'),
        ),
        body: buildBody(),
      ),
    );
  }
}
